<% if not logged_in? -%>
  <%= render :partial => 'account/rightbar' %>
<% else -%>

  <div id="sideRight">
    <% if is_admin? -%>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'INSTRUCTORES', 'hideme0' %></div>
        <div id="hideme0">
          <% if not @side_instructors.nil? -%>
            <% for instructor in @side_instructors -%>
              <div class="point"><%= link_to h(instructor.login), :controller => 'account', :action => 'view', :id => instructor.id %></div>
            <% end -%>
          <% end -%>
          <div class="point"><%= link_to 'Agregar', :controller => 'account', :action => 'signup_instructor' %></div>
        </div>
      </div>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'ADMINISTRADORES', 'hideme1' %></div>
        <div id="hideme1">
          <% if not @side_admins.nil? -%>
            <% for admin in @side_admins -%>
              <div class="point"><%= link_to h(admin.login), :controller => 'account', :action => 'view', :id => admin.id %></div>
            <% end -%>
          <% end -%>
          <div class="point"><%= link_to 'Agregar', :controller => 'account', :action => 'signup_admin' %></div>
        </div>
      </div>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'ESTUDIANTES', 'hideme2' %></div>
        <div id="hideme2">
          <% if not @side_students.nil? -%>
            <% for student in @side_students -%>
              <div class="point"><%= link_to h(student.login), :controller => 'account', :action => 'view', :id => student.id %></div>
            <% end -%>
          <% end -%>
          <div class="point"><%= link_to 'Agregar', :controller => 'account', :action => 'signup' %></div>
        </div>
      </div>

    <% else -%>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'MIS EVENTOS', 'hideme0' %></div>
        <div id="hideme0">
          <% if not @side_events_own.nil? -%>
            <% for event in @side_events_own -%> 
              <div class="point linkED"><%= link_to h(event.name), :controller => 'event', :action => 'view', :id => event %></div>
            <% end -%>
          <% else -%> 
            <div class="point">Sin eventos.</div>
          <% end -%>
          <%= link_to 'Agregar', :controller => 'event', :action => 'add' %>
        </div>
      </div>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'EVENTOS CURSOS', 'hideme1' %></div>
        <div id="hideme1">
          <% if not @side_events_courses.nil? -%>
            <% for event in @side_events_courses -%> 
              <div class="pointE">
                <span class="curso linkED"><%= link_to h(truncate(event.course.name, 7)), :controller => 'course', :action => 'show', :id => event.course.id %></span>: 
                <span class="linkED"><%= link_to h(event.name), :controller => 'event', :action => 'view', :id => event.id %></span>
              </div>
            <% end -%>
          <% else -%> 
            <div class="point">Sin eventos.</div>
          <% end -%>
        </div>
      </div>

      <div class="rightPanel">
        <div class="bordeTitulo2"><%= hide_on_click 'EVENTOS GLOBALES', 'hideme2' %></div>
        <div id="hideme2">
          <% if not @side_events_global.nil? -%>
            <% for event in @side_events_global -%> 
              <div class="point linkED"><%= link_to h(event.name), :controller => 'event', :action => 'view', :id => event %></div>
            <% end -%>
          <% else -%> 
            <div class="point linkED">Sin eventos.</div>
          <% end -%>
        </div>
      </div>

    <% end -%>
  </div>
<% end -%>
